package top.hekun.study.reptile;

import top.hekun.study.reptile.util.ReptileUtil;

import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 〈小说爬虫开始〉
 *
 * @author: Sakura
 * @date: 2023/5/16
 */
public class NovelReptileMain {
    /**
     * 文件存放目录
     */
    private static File filePath = new File(new File(System.getProperty("user.dir")), "NovelTxt");
    /**
     * 文件名称
     */
    private static String name = "史上最强炼气期-"+LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))+".txt";
    /**
     * 爬取地址
     */
    private static String url = "https://www.bswtan.com/36/36251/";
    /**
     * 爬取章节数, 倒数X章
     */
    private static Integer num = 100;

    public static void main(String[] args) throws IOException {
        filePath.mkdirs();
        ReptileUtil.novelReptile(filePath, name, url, num);
    }
}
